class Solution {
public:
    double minimumAverage(vector<int>& nums) {

        vector<double> arr;
        int n = nums.size();

        int cnt = n / 2;

        sort(nums.begin(), nums.end());

        int begin = 0, end = n - 1;
        while (cnt--)
        {
            double sum = (nums[begin] + nums[end]) / 2.0;

            begin++, end--;

            arr.push_back(sum);

        }

        double res = arr[0];
        for (auto x : arr)
            res = min(res, x);

        return res;

    }
};